/*
路由的入口文件
 */

import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from "../views/Home"
import About from "../views/About"
import News from "../views/News"
import Messages from "../views/Messages"
import MessagesDetail from "../views/MessagesDetail";

Vue.use(VueRouter)

export default new VueRouter({
  routes: [
    {
      path: '/home',
      component: Home,
      redirect: '/home/news',
      children: [
        {
          path: 'news',
          component: News
        },
        {
          path: 'messages',
          component: Messages,
          children: [
            {
              path: 'messagesDetail/:id',
              component: MessagesDetail
            }
          ]

        }
      ]
    },
    {
      path: '/about',
      component: About,

    },
    {
      path: '/',
      redirect: '/about'

    }
  ]
})
